import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { HeaderComponent } from './header/header.component';
import { FooterComponent } from './footer/footer.component';
import { SidebarComponent } from './sidebar/sidebar.component';
import {HttpClientModule} from "@angular/common/http";
import {MatIconRegistry} from "@angular/material";
import {DomSanitizer} from "@angular/platform-browser";
import {SkipSelf,Optional} from "@angular/core";
import {throwIfAlreadyLoaded} from "../services/module-import-guard"
import {loadSvgResources} from "../utils/svg.util";
import {ShareModule} from "../share/share.module";
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
import {ServiceModule} from "../service/service.module";
import {AppStoreModule} from "../reducers/index";
import{AppEffectModule} from "../effects";
import '../utils/debug.util';
@NgModule({
  imports: [
    ShareModule,
    HttpClientModule,
    RouterModule,
    AppStoreModule,
    AppEffectModule,
    ServiceModule.forRoot(),
    BrowserAnimationsModule
  ],
  declarations: [HeaderComponent, FooterComponent, SidebarComponent],
  exports:[HeaderComponent,FooterComponent,SidebarComponent,HttpClientModule]
})
export class CoreModule {
  constructor(@Optional()@SkipSelf()parent:CoreModule,ir:MatIconRegistry, si:DomSanitizer){
    if(parent){
      throwIfAlreadyLoaded(parent,'CoreModule')
    }
    loadSvgResources(ir,si);
  }
}
